from time import time
def doom(a):
    n=len(a)
    for i in range(n-1):
        for j in range(n-1-i):
            if a[j]>a[j+1]:
                a[j],a[j+1]=a[j+1],a[j]
    return a

t0=time()
f=open('m1_sorted.txt')
a=f.readlines()
b=[]
for i in range(len(a)):
    x=int(a[i])
    b.append(x)
c=doom(b)
f.close()
t1=time()
print('m1_sorted',round((t1-t0)*1000),'milliseconds')
t2=time()
f=open('m2_reverse.txt')
a=f.readlines()
b=[]
for i in range(len(a)):
    x=int(a[i])
    b.append(x)
c=doom(b)
t3=time()
print('m2_reverse',round((t3-t2)*1000),'milliseconds')
t4=time()
f=open('m3_shuffle.txt')
a=f.readlines()
b=[]
for i in range(len(a)):
    x=int(a[i])
    b.append(x)
c=doom(b)
t5=time()
print('m3_shuffle',round((t5-t4)*1000),'milliseconds')



